package com.smalls.redshoes.ui.widget;

import android.content.Context;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

import com.smalls.redshoes.R;

public class RecordDeleteDialog {
    private Context mContext;
    private CustomDialog mDialog;
    private OnDialogClick mDialogClick;

    public interface OnDialogClick {
        void onDialogNoClick();

        void onDialogYesClick();
    }

    public void setDialog(CustomDialog dialog, Context context) {
        this.mDialog = dialog;
        this.mContext = context;
        initView();
    }

    private void initView() {
        Button btn_delete_no = (Button) this.mDialog.findViewById(R.id.btn_delete_no);
        ((Button) this.mDialog.findViewById(R.id.btn_delete_yes)).setOnClickListener(new OnClickListener() {
            public void onClick(View v) {
                RecordDeleteDialog.this.mDialogClick.onDialogYesClick();
            }
        });
        btn_delete_no.setOnClickListener(new OnClickListener() {
            public void onClick(View v) {
                RecordDeleteDialog.this.mDialogClick.onDialogNoClick();
            }
        });
    }

    public void setOnDialogClick(OnDialogClick dialogClick) {
        this.mDialogClick = dialogClick;
    }
}
